package hjt.com.module_test.widget;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;

import androidx.annotation.Nullable;

public class Statusbar extends View {


    public Statusbar(Context context) {
        this(context,null);
    }

    public Statusbar(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs,0);
    }

    public Statusbar(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }


    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        Resources resources = getContext().getResources();
        int resourceId = resources.getIdentifier("status_bar_height", "dimen", "android");
        int height = resources.getDimensionPixelSize(resourceId);
        Log.e("ssssssss",widthMeasureSpec+":"+MeasureSpec.getSize(widthMeasureSpec));
        setMeasuredDimension(widthMeasureSpec, height);
    }

}
